import { ref, reactive } from 'vue'

// 生成普通牙齿数据
export interface ToothList {
  id: string,
  isActive: boolean,
  sub?: string,
	super?: string,
	isClick?: string,
}
let loopList = ['A', '1', 'B', '2', 'C', '3', 'D', '4', 'E', '5', '6', '7', '8']
export const getToothData = () => {
  let list = [] as ToothList[]
  for(let i = 0; i < loopList.length; i++) {
    list.push({
      id: loopList[i],
      isActive: false
    })
  }

  return list
}

// 生成复杂牙齿数据
interface ComplexToothData {
  isDel: boolean,
  val: string,
  Tleft: ToothList[],
  Tright: ToothList[],
  Bleft: ToothList[],
  Bright: ToothList[],
}
export const getFullToothData = (val= false) => {
  let obj = reactive({} as ComplexToothData)
  obj.isDel = val
  obj.val = ''
  obj.Tleft = [] as ToothList[]
  obj.Tright = [] as ToothList[]
  obj.Bleft = [] as ToothList[]
  obj.Bright = [] as ToothList[]
  for(let i = 0; i < loopList.length; i++) {
    obj.Tleft.push({
      id: loopList[i],
      isActive: false,
      sub: '',
      super: '',
      isClick: '',
    })

    obj.Tright.push({
      id: loopList[i],
      isActive: false,
      sub: '',
      super: '',
      isClick: '',
    })

    obj.Bleft.push({
      id: loopList[i],
      isActive: false,
      sub: '',
      super: '',
      isClick: '',
    })

    obj.Bright.push({
      id: loopList[i],
      isActive: false,
      sub: '',
      super: '',
      isClick: '',
    })
  }
  return obj
} 